deltas: Stub out a few more opcodes
authorColin Walters <walters@verbum.org>
Thu, 29 Jan 2015 22:54:59 +0000 (17:54 -0500)
committerColin Walters <walters@verbum.org>
Mon, 16 Feb 2015 15:10:35 +0000 (10:10 -0500)
src/libostree/ostree-repo-static-delta-private.h
src/libostree/ostree-repo-static-delta-processing.c

index 0661787f92ca261613427b6ac2b2c28dbc8ca6ac..09d4898a1a142d42ffa6a85f87b8596ce5e62e80 100644 (file)
@@ -135,6 +135,7 @@ typedef enum {
   OSTREE_STATIC_DELTA_OP_OPEN_SPLICE_AND_CLOSE = 'S',
   OSTREE_STATIC_DELTA_OP_OPEN = 'o',
   OSTREE_STATIC_DELTA_OP_WRITE = 'w',
+  OSTREE_STATIC_DELTA_OP_SET_READ_SOURCE = 'R',
   OSTREE_STATIC_DELTA_OP_CLOSE = 'c'
 } OstreeStaticDeltaOpCode;
 
index 4ca4002320e6c941ddc2b4c99a126fa86463b5e0..cdbd6174309408cb0a29c3433ad48d3a032c4757 100644 (file)
@@ -83,6 +83,10 @@ typedef struct  {
                                    GError                    **error);
 
 OPPROTO(open_splice_and_close)
+OPPROTO(open)
+OPPROTO(write)
+OPPROTO(set_read_source)
+OPPROTO(close)
 #undef OPPROTO
 
 static gboolean
@@ -223,6 +227,22 @@ _ostree_static_delta_part_execute_raw (OstreeRepo      *repo,
           if (!dispatch_open_splice_and_close (repo, state, cancellable, error))
             goto out;
           break;
+        case OSTREE_STATIC_DELTA_OP_OPEN:
+          if (!dispatch_open (repo, state, cancellable, error))
+            goto out;
+          break;
+        case OSTREE_STATIC_DELTA_OP_WRITE:
+          if (!dispatch_write (repo, state, cancellable, error))
+            goto out;
+          break;
+        case OSTREE_STATIC_DELTA_OP_SET_READ_SOURCE:
+          if (!dispatch_set_read_source (repo, state, cancellable, error))
+            goto out;
+          break;
+        case OSTREE_STATIC_DELTA_OP_CLOSE:
+          if (!dispatch_close (repo, state, cancellable, error))
+            goto out;
+          break;
         default:
           g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
                        "Unknown opcode %u at offset %u", opcode, n_executed);
@@ -533,3 +553,72 @@ dispatch_open_splice_and_close (OstreeRepo                 *repo,
     g_prefix_error (error, "opcode open-splice-and-close: ");
   return ret;
 }
+
+static gboolean
+dispatch_open (OstreeRepo                 *repo,
+               StaticDeltaExecutionState  *state,
+               GCancellable               *cancellable,  
+               GError                    **error)
+{
+  gboolean ret = FALSE;
+
+  if (!open_output_target (state, cancellable, error))
+    goto out;
+
+  ret = TRUE;
+ out:
+  if (!ret)
+    g_prefix_error (error, "opcode open: ");
+  return ret;
+}
+
+static gboolean
+dispatch_write (OstreeRepo                 *repo,
+               StaticDeltaExecutionState  *state,
+               GCancellable               *cancellable,  
+               GError                    **error)
+{
+  gboolean ret = FALSE;
+
+  g_assert_not_reached ();
+  
+  ret = TRUE;
+  /* out: */
+  if (!ret)
+    g_prefix_error (error, "opcode open-splice-and-close: ");
+  return ret;
+}
+
+static gboolean
+dispatch_set_read_source (OstreeRepo                 *repo,
+                          StaticDeltaExecutionState  *state,
+                          GCancellable               *cancellable,  
+                          GError                    **error)
+{
+  gboolean ret = FALSE;
+
+  g_assert_not_reached ();
+  
+  ret = TRUE;
+  /* out: */
+  if (!ret)
+    g_prefix_error (error, "opcode open-splice-and-close: ");
+  return ret;
+}
+
+static gboolean
+dispatch_close (OstreeRepo                 *repo,
+                StaticDeltaExecutionState  *state,
+                GCancellable               *cancellable,  
+                GError                    **error)
+{
+  gboolean ret = FALSE;
+
+  g_assert_not_reached ();
+  
+  ret = TRUE;
+  /* out: */
+  if (!ret)
+    g_prefix_error (error, "opcode open-splice-and-close: ");
+  return ret;
+}